import java.util.*;

public class Main {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        TreeMap<String,Integer> map2 = new TreeMap<>();
        Set<String> set = new TreeSet<>();
        set.add("mom");
        set.add("dad");
        for (String son: set) {
            System.out.println(son);
        }
        map2.put("fuck",5);
        map2.put("you",6);
        map2.put("shit",10);
        Set<String> set1 = map2.keySet(); //取出map2中的不重复的集合
        Collection<Integer> collection = map2.values();//取出map2中的重复的集合
        Set<Map.Entry<String,Integer>> entries = map2.entrySet(); //收集映射关系

        for (Map.Entry<String,Integer> entry:entries) {
            System.out.println("key: "+entry.getKey()+" value: "+entry.getValue());
        }

//        int val = map2.get("fuck"); //返回出现的次数0
//        System.out.println(val);
//        //如果不存在要查找的值就返回250
//        int val1 = map2.getOrDefault("bitch",250);
//        System.out.println(val1);
        System.out.println("===========");
    }
}